home *** CD-ROM | disk | FTP | other *** search
- Path: news.infi.net!usenet
- From: nngis@norfolk.infi.net (Greg DiGiorgio)
- Newsgroups: comp.lang.c
- Subject: Re: Which C compiler?
- Date: 17 Feb 1996 13:48:37 GMT
- Organization: Customer of InfiNet
- Distribution: world
- Message-ID: <4g4mbl$n5t@nw002.infi.net>
- References: <56c21b5c56c21b5c@iconet.hongkong.net>
- NNTP-Posting-Host: h-werewolf.norfolk.infi.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- In article <56c21b5c56c21b5c@iconet.hongkong.net>,
- wong.yuk.wah%f18.n1000.z128@iconet.hongkong.net says...
- >
- >Hi!
- >
- >I'm a beginner in C programming. Just having learnt the basic concept of
- C,
- >I found I still couldn't write a *real* program. The ANSI standard
- doesn't
- >provide the variety of functions that a usual program needs, such as
- text
- >color, graphics, and that kind of interface stuff.
-
- That is true, very true. And for reasons like that, you must step outside
- of the ANSI standard. But the idea of the ANSI std is not to make 'C'
- 100% portable, but to simply make a good portion of the code
- platform-independent. For example, assume you write 'C' programs for
- Windows, invoking the Windows API and you want to port to UNIX X-windows.
- Much of your "user-interface" code will have to be rewritten to run on
- X-windows (or you must have a tool that knows how to xlat Windows API
- calls to X-windows). But the brainy part of your code - where you do
- calculations and the like - will probably be portable if you stick with
- standard 'C' library functions.
-
- >
- >So I'm facing a problem. The fact is that I'm using Turbo C++ 3.00 for
- >learning purpose. There's lots of libraries helping achieve the desired
- >effects, such as BGI. But BGI certainly won't be included in Microsoft
- >C/C++ (not mentioning Visual C++ that I *cannot* use!). So I think
- >switching from a C implementation to another is rather difficult. But
- what
- >implementation should I choose? There are so many different versions of
- >C/C++, like Borland, Turbo, Microsoft, Symantec, and so on. After I've
- >made my choice, I want to stick to it. But the problem is which one I
- >should choose.
-
- It depends... First, you must decide which platforms
- (DOS/OS2/Windows/UNIX) you want to develop for? Once you've done that,
- then pick the compiler that provides for most target systems. Beware that
- once you've done that, you are locked into that compiler for the
- system-dependent code. The upside is that multi-platform compilers allow
- you to have one set of source code that runs on more than one OS.
-
- As for sticking with just one compiler, here's an example of why you
- might not want to do that: I wrote a DOS-based 'C' screen painter/code
- generator. I wrote all the platform-dependent code in assembler (gotoxy,
- kbhit, textcolor, textbackgorund, mouse functions, etc). That allowed me
- to have compiler independence, at least in DOS. As such, I compiled my
- 'C' libraries in Turbo-C, Turbo-C/C++ (all versions), Borland C/C++ (all
- versions), and MS-C V6.0. Doing so, allowed me to target the big DOS
- compilers (at that time) to have the widest possible audience for my
- package. If I had become dependent on say, Turbo-C only, my potential
- customer base would have been much smaller.
-
- >
- >Can anyone tell me what is more suitable? By the way, I learnt from
- books
- >that C is famous for its portability. How's the portability differs
- among
- >the various versions? Thanks a lot!
-
- For DOS only, I'd use Turbo-C/C++. For DOS & Windows, I'd prefer Borland.
- For Windows only, I'd use MS-VC/C++ 4.0, For other platforms, there is a
- single mfr that makes a C/C++ compiler that goes against most everything,
- but I can't remember the name - even though we have it at work. The mfr
- name is about as recognizable (or non-recognizable) as Symantec.
-
-
- >
- >Regards,
- >Wong Yuk Wah
- >
- >* Origin: IcoNET <--> Internet/Usenet gateway, 128:1000/1 (128:1000/1)
-
- Hope this helps,
- Greg DiGiorgio
-
-